//
//  ClassifyData.m
//  __PRODUCTNAME__
//
//  Created by dllo on 16/09/10
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "ClassifyData.h"
#import "ClassifyCategorydoc.h"
#import "ClassifyOrderdoc.h"
#import "ClassifyTimedoc.h"

@implementation ClassifyData

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"TimeDoc"]) {
        _TimeDoc = [ClassifyTimedoc modelWithDic:value];
    } else if ([key isEqualToString:@"CategoryDoc"]) {
        NSMutableArray *arr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ClassifyCategorydoc *category = [ClassifyCategorydoc modelWithDic:dic];
            [arr addObject:category];
        }
        _CategoryDoc = arr;
    } else if ([key isEqualToString:@"OrderDoc"]) {
        NSMutableArray *arr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ClassifyOrderdoc *category = [ClassifyOrderdoc modelWithDic:dic];
            [arr addObject:category];
        }
        _OrderDoc = arr;

    }
}

@end
